import request from '@/utils/request'

export default {
  //获取课程章节和小节信息
  getAllChapterVideo(courseId){
    return request({
      url: '/eduService/chapter/getChapterVideo/'+courseId,
      method: 'get'
    })
  },

  //添加章节
  addChapter(chapter){
    return request({
      url: '/eduService/chapter/addChapter',
      method: 'post',
      data: chapter
    })
  },

  //通过id查询章节
  getChapterById(courseId){
    return request({
      url: '/eduService/chapter/getChapterInfo/'+courseId,
      method: 'get'
    })
  },
  //更新章节信息
  updateChapter(chapter){
    return request({
      url: '/eduService/chapter/updateChapter',
      method: 'post',
      data: chapter
    })
  },
  //删除章节信息
  deleteChapterById(courseId){
    return request({
      url: '/eduService/chapter/'+courseId,
      method: 'delete'
    })
  },
}
